package lumis.doui.search;

import lumis.portal.PortalException;
import lumis.portal.UnexpectedException;
import lumis.portal.manager.ManagerFactory;

/**
 * Factory for IReindexerTabularDataProcessor implementation instances
 *
 * @version $Revision: 12538 $ $Date: 2011-02-09 12:07:10 -0200 (Wed, 09 Feb 2011) $
 * @since 4.0.7
 */
public class ReindexerTabularDataProcessorFactory
{
	public static IReindexerTabularDataProcessor create(String className) throws PortalException
	{
		IReindexerTabularDataProcessor reindexerTabularDataProcessor = null;
		try
		{
			reindexerTabularDataProcessor = (IReindexerTabularDataProcessor)ManagerFactory.getDeploymentManager().getClassLoader().loadClass(className).newInstance();
		}
		catch (ClassNotFoundException e)
		{
			throw new PortalException("STR_REINDEXERTABULARDATAPROCESSOR_CLASS_NOT_FOUND;" + className);
		}
		catch (Exception e)
		{
			throw new UnexpectedException(e);
		}
		return reindexerTabularDataProcessor;
	}
}
